<!DOCTYPE html>
<!--
Copyright 2013 The Polymer Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<html>
<head>
  <meta charset="utf-8">
  <script src="../src/CustomElements.js"></script>
  <script>
    HTMLElementElement = document.register('element', {
      prototype: Object.create(HTMLElement.prototype, {
        readyCallback: {
          value: function() {
            parseElementElement.call(this);
          }
        }
      })
    });
    function parseElementElement() {
      console.log(this.getAttribute('name'));
      var script = this.querySelector('script');
      console.log(script.textContent);
    };
  </script>
</head>
<body>
  <element name="x-foo">
    <script>
      (this !== window) && this.lifecycle({});
    </script>
  </element>
  <script>
    // we didn't load Parser.js, so do this manually
    document.upgradeElements();
  </script>
</body>
</html>
